package com.jbit.dm_160.utils;

import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.net.Inet4Address;
import java.util.List;
@Data
public class Page<T> {
    private Integer currentPage;
    private Integer pageCount;
    private Integer pageSize;
    private List<T> rows;

    public static <T> Page<T> clone(PageInfo<T> pageInfo){
        Page<T> page = new Page();
        page.setCurrentPage(pageInfo.getPageNum());
        page.setPageCount(pageInfo.getPages());
        page.setPageSize(pageInfo.getPageSize());
        page.setRows(pageInfo.getList());
        return page;
    }
}
